<div class="p-20">

    <!-- 节点基本信息 begin-->
    <p-panel headerClass="bg-none " contentClass="p-0" styleClass="radius-none">
        <p-header>
            <div class="text-right p-6-0" style="height: 48px;">
                <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10">
                    {{adviserData.name}}
                    <span class="panel-status-success">{{storage.dicFilter('nodestatus', adviserData.status)}}</span>
                </span>
                <button pButton type="button" (click)="punishments(adviserData.status);" label="发起处罚" class="btn-secondary"></button>
            </div>
        </p-header>

        <div class="p-20 border-b-d9d9d9">
            <form #form="ngForm" novalidate class="form-horizontal" role="form">
                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1 width-128 v-top">基础信息：</div>
                    <div class="table-cell width-800">
                        <p-doubleTable [titleWidth]="140" [style]="{width:'800px'}" [value]="adviserData" [rowClos]="adviserHead">
                        </p-doubleTable>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1 width-128 v-top">施工标准：</div>
                    <div class="table-cell width-800">
                        <p-dataTable [value]="cars3" [showTableHeader]="true">
                            <p-column field="a" header="序号" [style]="{'width':'140'}">
                                <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                                    {{ri+1}}
                                </ng-template>
                            </p-column>
                            <p-column field="b" header="施工标准" [style]="{'width':'660px'}"></p-column>
                        </p-dataTable>
                    </div>
                </div>

            </form>
        </div>
    </p-panel>
    <!-- 节点基本信息 end-->

    <!-- 检测项目  begin -->
    <p-panel headerClass="bg-none " contentClass="p-0" styleClass="m-t-20 radius-none" *ngFor="let checkDetail of checkList">
        <p-header>
            <div class="text-right p-6-0">
                <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10">
                    {{checkDetail.sortNum}}、{{checkDetail.checkStandard}}
                    <span class="panel-status-success" *ngIf="checkDetail.result">{{storage.dicFilter('checkstandardresult', checkDetail.result)}}</span>
                </span>
                <button pButton type="button" (click)="openDialog(checkDetail.id,adviserData.status)" label="发起整改" class="btn-secondary"></button>
            </div>
        </p-header>
        <div class="p-20 border-b-d9d9d9">
            <form #form="ngForm" novalidate class="form-horizontal" role="form">
                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1">检查项目：</div>
                    <div class="table-cell">
                        {{checkDetail.checkItem}}
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1">配备工具：</div>
                    <div class="table-cell">
                        {{checkDetail.toolConfig}}
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1">拍摄要求：</div>
                    <div class="table-cell">
                        {{checkDetail.tackPhoneRequire}}
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1">照片张数：</div>
                    <div class="table-cell">
                        {{checkDetail.phoneRequire}}
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1">是否为必过项：</div>
                    <div class="table-cell">
                        {{checkDetail.isRequestPassItem ? '是':'否'}}
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1" style="vertical-align:top">拍摄照片：</div>
                    <div class="table-cell">
                        <div class="pull-left" style="margin-left:-10px;" *ngIf="checkDetail.photoArr&&checkDetail.photoArr.length>0">
                            <p-lightboxfile styleClass="inline-block" appendTo="body" [images]="checkDetail.photoArr" [showDelete]="false"></p-lightboxfile>
                        </div>
                    </div>
                </div>

                <div class="table-row">
                    <div class="table-cell text-right p-l-25 color-b1b1b1">说明：</div>
                    <div class="table-cell">
                        {{checkDetail.description}}
                    </div>
                </div>

                <div class="table-row" *ngIf="checkDetail.modify&&checkDetail.modify.length>0">
                    <div class="table-cell text-right p-l-25 color-b1b1b1 width-128  v-top">整改记录：</div>
                    <div class="table-cell">
                        <p-dataTable [value]="checkDetail.modify" [showTableHeader]="true">
                            <p-column field="sortNum" header="序号" [style]="{'width':'80px'}">
                                <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                                    {{ri+1}}
                                </ng-template>
                            </p-column>
                            <p-column field="modifyRecord" header="整改项" [style]="{'width':'150px'}">
                                <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                                    <div style="color:#1a91eb;cursor:pointer;">
                                        <!-- (click)="info('1')" -->
                                        <a class="color-1a91eb" [title]="car[col.field]" target="_blank" [routerLink]="['/saas/engineer/constructionprocess/constructionmanage/modifyrecord', car.id,businessId]">
                                            {{car[col.field]}}
                                        </a>
                                    </div>
                                </ng-template>
                            </p-column>
                            <p-column field="deadlineText" header="最后期限" [style]="{'width':'90px'}"></p-column>
                            <p-column field="isCustomScan" header="客户是否可见" [style]="{'width':'100px'}">
                                <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                                    {{car[col.field] ? '客户可见' : '客户不可见'}}
                                </ng-template>
                            </p-column>
                            <p-column field="modify" header="整改人" [style]="{'width':'100px'}"></p-column>
                            <p-column field="status" header="状态" [style]="{'width':'80px'}">
                                <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                                    {{storage.dicFilter('modifystatus', car[col.field])}}
                                </ng-template>
                            </p-column>
                            <p-column field="create" header="提交人" [style]="{'width':'100px'}"></p-column>
                            <p-column field="dateCreatedText" header="提交时间" [style]="{'width':'120px'}"></p-column>
                        </p-dataTable>
                    </div>
                </div>
            </form>
        </div>
    </p-panel>
    <!-- 检测项目  begin -->

    <!-- 操作记录 begin-->
    <p-panel headerClass="bg-none " contentClass="p-0" styleClass="m-t-20 radius-none">
        <p-header>
            <div class="text-right p-6-0" style="height: 48px;">
                <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10">
                    操作人记录
                </span>
            </div>
        </p-header>
        <div class="p-20 border-b-d9d9d9">
            <p-dataTable [value]="cars2" [showTableHeader]="true">
                <p-column field="sortNum" header="序号" [style]="{'width':'8%'}">
                    <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                        {{ri+1}}
                    </ng-template>
                </p-column>
                <p-column field="operationContent" header="操作"></p-column>
                <p-column field="afterSubmitStatus" header="提交后状态">
                    <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                        {{storage.dicFilter('nodestatus', car[col.field])}}
                    </ng-template>
                </p-column>
                <p-column field="submitPerson" header="提交人"></p-column>
                <p-column field="submitPersonMobile" header="手机号"></p-column>
                <p-column field="submitTimeText" header="提交时间"></p-column>
                <p-column field="isAutoConfirm" header="是否是自动确认">
                    <ng-template let-col let-car="rowData" let-ri="rowIndex" pTemplate="body">
                        {{car[col.field] ? '是' : '否'}}
                    </ng-template>
                </p-column>
            </p-dataTable>
        </div>
    </p-panel>
    <!-- 操作记录 end-->


    <!-- 表单 begin-->
    <p-dialog [header]="'发起整改'"  [(visible)]="isShow" (onHide)="submited=false;photoError=''" modal="modal" width="700" [responsive]="true">
        <div class="text-center wrap-content">
            <div class="inline-block" *ngIf="isShow">
                <form #form="ngForm" (ngSubmit)="form.form.valid" novalidate class="form-horizontal" role="form">
                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 p-required width-128">整改项：</div>
                        <div class="table-cell text-left relative">
                            <input type="text" name="modifyRecord1" (focus)="modifyRecordRight=false" (blur)="modifyRecordRight=true" #modifyRecord1="ngModel"
                                class="p-input width-220" placeholder="请输入整改项" required pInputText [(ngModel)]="formObj.modifyRecord"
                                maxlength="25" [ngClass]="modifyRecordRight && (modifyRecord1.errors?.required && (modifyRecord1.touched || submited))?'p-input-error':'p-input-error-none'">
                            <p-message *ngIf="modifyRecordRight" [severity]="'error'" [text]="{'请输入整改项':modifyRecord1.errors?.required&&(modifyRecord1.touched || submited)}"></p-message>
                        </div>
                    </div>
                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 width-128">项目名称：</div>
                        <div class="table-cell text-left">
                            {{modifyInitData.businessOpportunityName+' '+modifyInitData.businessOpportunityCode}}
                        </div>
                    </div>
                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 p-required width-128">最后期限：</div>
                        <div class="table-cell text-left">
                            <!-- <p-calendar name="deadline" #deadline="ngModel" [minDate]="deadlineMin" [(ngModel)]="formObj.deadline" styleClass="p-calendar width-220"
                                placeholder="请选择最后期限" (onSelect)="deadlineRight=true" inputStyleClass="height-full" required (onFocus)="deadlineRight=false"
                                (onBlur)="deadlineRight=true"></p-calendar>
                            <p-message [severity]="'error'" *ngIf="deadlineRight" [text]="{'请选择最后期限':deadline.errors?.required&&(deadline.touched || submited)}"></p-message>
                            -->
                            <p-calendar name="deadline" #deadline="ngModel" [minDate]="deadlineMin" [(ngModel)]="formObj.deadline" styleClass="p-calendar width-220"
                                placeholder="请选择最后期限" (onSelect)="deadlineCk()" (onClearClick)="deadlineCk()" inputStyleClass="height-full" required
                               ></p-calendar>
                               <p-message [severity]="'error'" *ngIf="deadlineEndTimeError" [text]="deadlineEndTimeError"></p-message>

                        </div>
                    </div>

                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 width-128">整改人：</div>
                        <div class="table-cell text-left">
                            {{modifyInitData.foremanName+' 项目经理'}}
                        </div>
                    </div>

                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 p-required width-128">客户是否可见：</div>
                        <div class="table-cell text-left">
                            <p-dropdown name="isCustomScan" #isCustomScan="ngModel" styleClass="width-220" [options]="isCustomerScan" [(ngModel)]="formObj.isCustomScan"
                                [justValue]="true" placeholder="请选择" dataKey="code" optionLabel="name" required></p-dropdown>
                            <p-message [severity]="'error'" [text]="{'请选择客户是否可见':isCustomScan.errors?.required&&(isCustomScan.touched || submited)}"></p-message>
                        </div>
                    </div>

                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 p-required width-128" style="vertical-align:top">
                            拍摄图片：
                        </div>

                        <div class="table-cell text-left " style="width:390px">
                            <div class="pull-left load-img" *ngIf="photoImages && photoImages.length>0">
                                <p-lightboxfile appendTo="body" (removeItem)="removeItem($event,'photo');photoCk()" styleClass="inline-block" [images]="photoImages" [showDelete]="true"></p-lightboxfile>
                            </div>
                            <div class="ui-g-12 ui-g-nopad">
                                <a (click)="recoverModifyImage();photoCk()" style="color:#1a91eb;text-decoration:underline !important;cursor: pointer;">恢复图片</a>
                            </div>
                        </div>
                    </div>

                    <div style="text-align: left;">
                        <p-message *ngIf="photoError" styleClass='error-meaage' severity="error" [text]="photoError"></p-message>
                    </div>
                    <div class="table-row">
                        <div class="table-cell text-right p-l-25 p-required width-128 v-top">说明：</div>
                        <div class="table-cell text-left  relative">
                            <textarea rows="5" name='description' (focus)="descriptionRight=false" (blur)="descriptionRight=true" #description="ngModel"
                                [(ngModel)]="formObj.description" cols="30" maxlength="50" pInputTextarea placeholder="请输入说明"
                                [ngStyle]="{'width': '220px' }" required [ngClass]="descriptionRight && (description.errors?.required&&(description.touched || submited))?'p-input-error':'p-input-error-none'"></textarea>
                            <p-message [severity]="'error'" *ngIf="descriptionRight" styleClass="p-centerText" [text]="{'请输入说明':description.errors?.required&&(description.touched || submited)}"></p-message>
                            <div class="text-right opacity06">还可输入{{50 - (formObj.description?.length || 0)}}个字</div>

                        </div>
                    </div>

                    <div class="table-row">
                        <div class="table-cell text-right p-l-25"></div>
                        <div class="table-cell text-left">
                            <button pButton type="button" (click)="deadlineCk();photoCk();form.form.valid?submitDialog():submited = true" [label]="'提交'" class="btn btn-success m-btn-dialog"></button>
                        </div>
                    </div>
                </form>

            </div>
        </div>
    </p-dialog>
    <!-- 表单 end-->

</div>

<!-- 处罚弹窗组件 -->
<app-list-punish-dialog *ngIf="isPunishShow" [data]="punishmentsData" [isShow]="isPunishShow" (changeIsShow)="changePunishShow($event)"></app-list-punish-dialog>
<!-- 处罚弹窗组件end -->
